package xml.saxParserExample;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


public class ShowBookApp {
	public static void main(String[] args) {
		Display display = Display.getDefault();
		final Shell shell = new Shell(display);
		shell.setText("Books Demo");
		shell.setLayout(new GridLayout());
		shell.setSize(100, 100);
		Button showAllBooks = new Button(shell,SWT.PUSH);
		showAllBooks.setText("Show All Books");
		showAllBooks.addSelectionListener(new SelectionAdapter(){
			public void widgetSelected(SelectionEvent arg0) {
				ShowBookDialog dialog = new ShowBookDialog(shell);
				dialog.open();				
			}
			
		});
		shell.open();
		//shell.pack();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		
	}
}
